package ooday04;


import ooday03.*;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
public class TimerDemo {
    public static void main(String[] args) {

        System.out.println(3+6+"a");
        /*Timer t=new Timer();
        int interval=1000;//1000ms
        Date date=new Date(System.currentTimeMillis()-5000);
        TimerTask tt=new TimerTask() {
            @Override
            public void run() {
                System.out.println("run...");
            }
        };
        System.out.println(date);
        //t.schedule(tt,-5000,1000);
        t.schedule(tt, date,1000);*/
        Timer timer=new Timer();
       // Date
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("起床了");
            }
        },1000,2000);
    }
}

